package com.cs.cssupplier.controller;

import com.cs.cssupplier.domain.CsOperator;
import com.cs.cssupplier.service.CsOperatorService;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author：lyj
 * @Package：com.cs.cssupplier.controller
 * @Project：RuoYi-Cloud-master
 * @name：CsOperatorController
 * @Date：2024/11/25 9:01
 * @Filename：CsOperatorController
 */
@RestController
@RequestMapping("/operator")
public class CsOperatorController extends BaseController {
    @Autowired
    private CsOperatorService csOperatorService;
    /**
     * 获取业务经办人信息详细信息
     */
    @GetMapping(value = "/{ywId}")
    public AjaxResult getInfo(@PathVariable("ywId") Long ywId) {
        return success(csOperatorService.selectCsOperatorByYwId(ywId));
    }

    @GetMapping(value = "/getInfoByHid/{hid}")
    public AjaxResult getInfoByHid(@PathVariable("hid") Long hid) {
        return success(csOperatorService.selectCsOperatorByHid(hid));
    }
    /**
     * 查询业务经办人信息列表
     */
    @GetMapping("/list")
    public TableDataInfo list(CsOperator csOperator) {
        startPage();
        List<CsOperator> list = csOperatorService.selectBsOperatorList(csOperator);
        return getDataTable(list);
    }
}
